package com.note.redisLock.redLock;

/**
 * @ClassName DistributedLocker
 * @Description TODO
 * @Author QiBin
 * @Date 2020/6/1010:49
 * @Version 1.0
 **/

import org.redisson.api.RLock;

import java.util.concurrent.TimeUnit;

public interface DistributedLocker {

    RLock lock(String lockKey);

    RLock lock(String lockKey, int timeout);

    RLock lock(String lockKey, TimeUnit unit, int timeout);

    boolean tryLock(String lockKey, TimeUnit unit, int waitTime, int leaseTime);

    void unlock(String lockKey);

    void unlock(RLock lock);
}